<template>
	<view style="padding: 20rpx 20rpx;">
		<!-- 顶部 -->
		<view style="display: flex;justify-content: space-between;align-items: center;">
			<text style="font-size: 50rpx;color: #000000;">为你推荐</text>
			<text>可用积分:<text style="color: #fae8ad;">{{points}}积分</text></text>
		</view>
		<!-- 商品列表 -->
		<view class="">
			<u-grid col="2">
				<u-grid-item v-for="(item,index) in [0,1,2,3,4]">
					<view class="grid_item" @click="toproductDetails(index)">
						<image style="width: 200rpx;height: 200rpx;margin-bottom: 10rpx;" src="../../static/image/4.jpg" mode="aspectFill">
						</image>
						<text style="width: 100%;">环保单肩包</text>
						<text style="color: #fae8ad;">{{points}}积分</text>
					</view>
				</u-grid-item>
			</u-grid>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				points: 1300
			}
		},
		methods: {
			toproductDetails(){
				uni.navigateTo({
					url:"./productDetails"
				})
			}
		}
	}
</script>

<style>
	page {
		background-color: #f7fafd;
	}
	.grid_item{
		width: 300rpx;
		margin-top: 30rpx;
		padding: 30rpx 10rpx;
		border-radius: 10rpx;
		box-shadow: 0 0 30rpx #d9d9d9;
		align-items: center;
		text-align: center;
		background-color: #ffffff;
		display: flex;
		flex-direction: column;
		overflow:hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
</style>